var net = require('net');

//连接服务器
var client = net.connect({port:8080},function(){
	console.log('connected to server');
	client.write('World!\r\n');
});

//接受服务器端的数据
client.on('data',function(data){
	console.log('client got data from server: ',data.toString());

	//断开连接
	client.end();
});

client.on('end',function(){
	console.log('disconnected from server');
});


















